{template 'header', $module}
<div class="tinfo">
   <!--房源信息-->
<div class="menus">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="add"><a href="ask.php?action=add"><span>提交新问题</span></a></td>
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="home"><a href="ask.php"><span>问题及解答</span></a></td>
{if $support}
<td class="tab_nav">&nbsp;</td>
<td class="tab" id="support"><a href="support.php"><span>客服专员</span></a></td>
{/if}
</tr>
</table>
</div>

{if $action == 'add'}
<form method="post" action="ask.php" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="houseid" value="{$houseid}"/>
<table  class="sell1" width="755"  border="1">
<tr>
<td class="tl"> <span class="f_red">*</span> 分 类</td>
<td class="tr">{$type_select} <span id="dtypeid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"> <span class="f_red">*</span> 标 题</td>
<td class="tr"><input type="text" size="50" name="title" id="title"/> [限5-30字之间] <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"> <span class="f_red">*</span> 内 容</td>
<td class="tr"><textarea name="content" id="content" class="dsn"></textarea>
{deditor($moduleid, 'content', 'Simple', '98%', 300)}[限10-5000字之间] <span id="dcontent" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"> </td>
<td class="tr"><input type="submit" name="submit" value=" 确 定 " class="sBtn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" name="reset" value=" 重 置 " class="sBtn"/></td>
</tr>
</table>
</form>
<script type="text/javascript">s('ask');m('add');</script>
{elseif $action == 'edit'}
<form method="post" action="ask.php" onsubmit="return check();">
<input type="hidden" name="forward" value="{$forward}"/>
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="itemid" value="{$itemid}"/>
<table cellspacing="1" cellpadding="3" class="tb">
<tr>
<td class="tl"> <span class="f_red">*</span> 分 类</td>
<td class="tr">{$type_select} <span id="dtypeid" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"> <span class="f_red">*</span> 标 题</td>
<td class="tr"><input type="text" size="50" name="title" id="title" value="{$title}"/> [限5-30字之间] <span id="dtitle" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"> <span class="f_red">*</span> 内 容</td>
<td class="tr"><textarea name="content" id="content" class="dsn">{$content}</textarea>
{deditor($moduleid, 'content', 'Simple', '98%', 200)}[限10-5000字之间] <span id="dcontent" class="f_red"></span></td>
</tr>
<tr>
<td class="tl">&nbsp;</td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 修 改 " class="sBtn"/>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value=" 返 回 " class="sBtn" onclick="history.back(-1);"/></td>
</tr>
</table>
</form>
<script type="text/javascript">s('ask');m('home');</script>
{elseif $action == 'show'}
<table cellspacing="1" cellpadding="10" class="tb">
<tr>
<td class="tl">问题分类</td>
<td class="tr">{$TYPE[$typeid][typename]}</td>
</tr>
<tr>
<td class="tl">问题标题</td>
<td class="tr f_b">{$title}</td>
</tr>
<tr>
<td class="tl">问题内容</td>
<td class="tr" style="line-height:180%;">{$content}</td>
</tr>
<tr>
<td class="tl">提交时间</td>
<td class="tr">{$addtime}</td>
</tr>
<tr>
<td class="tl">受理状态</td>
<td class="tr">{$dstatus[$status]}</td>
</tr>
{if $status > 1}
<tr>
<td class="tl">问题回复</td>
<td class="tr" style="line-height:180%;background:#FFFFFF;border:#86A2C0 1px dotted;">{$reply}</td>
</tr>
<tr>
<td class="tl">受理时间</td>
<td class="tr f_blue">{$admintime}</td>
</tr>
<tr>
<td class="tl">受理人</td>
<td class="tr">{$admin}</td>
</tr>
<tr>
<td class="tl">我的评价</td>
<td class="tr">
{if $star}
{$stars[$star]}
{else}
<form method="post" action="ask.php?action=star&itemid={$itemid}">
<input type="radio" name="star" value="1" id="star_1"/><label for="star_1"> 不满意</label>
<input type="radio" name="star" value="2" id="star_2"/><label for="star_2"> 基本满意</label>
<input type="radio" name="star" value="3" id="star_3"/><label for="star_3"> 非常满意</label>
<input type="submit" name="submit" class="sBtn" value=" 评 价 "/>
</form>
{/if}
</td>
</tr>
{/if}
</table>
</form>
<script type="text/javascript">s('ask');m('home');</script>
{else}
<div class="ls">
<table cellspacing="0" cellpadding="0" class="tb">
<tr>
<th>流水号</th>
<th>状态</th>
<th>标题</th>
<th width="150">添加时间</th>
<th>分类</th>
<th width="60">修改</th>
<th width="60">删除</th>
</tr>
{loop $asks $k $v}
<tr onmouseover="this.className='on';" onmouseout="this.className='';" align="center">
<td>&nbsp;{$v[itemid]}&nbsp;</td>
<td>&nbsp;{$v[dstatus]}&nbsp;</td>
<td align="left"><a href="ask.php?action=show&itemid={$v[itemid]}" class="t">{$v[title]}</a></td>
<td>{$v[addtime]}</td>
<td><a href="ask.php?typeid={$v[typeid]}">{$v[type]}</a></td>
<td>
{if $v[status] == 0}<a href="ask.php?action=edit&itemid={$v[itemid]}&forward={urlencode($AJ_URL)}"><img width="16" height="16" src="image/edit.png" title="修改" alt=""/></a>{else}--{/if}
</td>
<td>
<a href="javascript:confirmURI('确定要删除吗？此操作将不可撤销', 'ask.php?action=delete&itemid={$v[itemid]}&forward={urlencode($AJ_URL)}');"><img width="16" height="16" src="image/delete.png" title="删除" alt=""/></a>
</td>
</tr>
{/loop}
</table>
</div>
<div class="pages">{$pages}</div>
<script type="text/javascript">s('ask');m('home');</script>
{/if}
{if $action=='add' || $action=='edit'}
<script type="text/javascript">
function check() {
	var len;
	if(Dd('typeid').value == 0) {
		Dmsg('请选择分类', 'typeid');
		return false;
	}
	len = Dd('title').value.length;
	if(len < 5 || len > 30) {
		Dmsg('标题不能少于5个字多于30个字，当前已输入'+len+'个字', 'title');
		return false;
	}
	len = FCKLen();
	if(len < 10 || len > 5000) {
		Dmsg('内容不能少于10个字多于5000个字，当前已输入'+len+'个字', 'content');
		return false;
	}
	return true;
}
</script>
{/if}
</div>
</div></div>
{template 'footer'}